//
//  HomeViewController.m
//  TapHomeApp
//
//  Created by go me on 2022/2/23.
//

#import "HomeViewController.h"
#import "DetailViewController.h"

@interface HomeViewController ()

@end

@implementation HomeViewController

-(instancetype)init{
    self = [super init];
    if (self) {
        self.tabBarItem.title = @"首页";
        self.tabBarItem.image = [UIImage imageNamed:@"tabbar_home"];
        self.tabBarItem.selectedImage = [UIImage imageNamed:@"tabbar_homeme"];
        self.tabBarController.tabBar.backgroundColor = [UIColor redColor];
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.view addSubview:({
        UIButton *tapButton = [UIButton buttonWithType:UIButtonTypeCustom];
        tapButton.frame = CGRectMake(0, 100, 100, 60);
        tapButton.backgroundColor = UIColor.lightGrayColor;
        [tapButton addTarget:self action:@selector(tapClick) forControlEvents:UIControlEventTouchUpInside];
        [tapButton setTitle:@"点击我" forState:UIControlStateNormal];
        tapButton;
    })];
    
    // Do any additional setup after loading the view.
}

- (void)tapClick{
    
    DetailViewController *Vc = [DetailViewController new];
    [self.navigationController pushViewController:Vc animated:YES];
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
